#app {
  .main-container {
    min-height: 100%;
    transition: margin-left 0.28s;
    margin-left: $sideBarWidth;
    position: relative;
    background: #fff;
  }

  .sidebar-container {
    transition: width 0.28s;
    width: $sideBarWidth !important;
    height: 100%;
    position: fixed;
    font-size: 0px;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1001;
    overflow: hidden;

    // reset element-ui css
    .horizontal-collapse-transition {
      transition: 0s width ease-in-out, 0s padding-left ease-in-out,
        0s padding-right ease-in-out;
    }

    .scrollbar-wrapper {
      margin-right: 0 !important;
      overflow: hidden !important;
      overflow-y: auto !important;
      scrollbar-gutter: stable;
      .el-scrollbar__view {
        width: 90%;
        margin: 15px auto;
      }
      &::-webkit-scrollbar {
        width: 6px;
      }

      &::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.05);
        border-radius: 3px;
      }

      &::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.2);
        border-radius: 3px;

        &:hover {
          background: rgba(255, 255, 255, 0.3);
        }
      }

      .el-scrollbar__view {
        width: 90%;
        margin: 15px auto;
      }
    }

    .el-scrollbar__bar.is-vertical {
      right: 0px;
      width: 0px;
    }

    .el-scrollbar {
      height: calc(100vh - 100px);
    }
    .el-scrollbar .el-scrollbar__thumb {
      height: 100% !important;
    }
    &.has-logo {
      .el-scrollbar {
        height: calc(100vh- 100px);
      }
    }

    .is-horizontal {
      display: none;
    }

    a {
      display: inline-block;
      width: 100%;
      // overflow: hidden;
    }

    .svg-icon {
      margin-right: 16px;
      font-size: 18px;
      height: 18px;
    }

    .sub-el-icon {
      margin-right: 12px;
      margin-left: -2px;
    }

    .el-menu {
      border: none;
      height: 100%;
      width: 100% !important;
    }

    // menu hover
    .submenu-title-noDropdown {
      &:hover {
        background: rgb(22 93 255 / 0.1) !important;
        border-radius: 0.5rem;
        .sub-el-icon {
          color: rgb(22 93 255 / var(--tw-text-opacity, 1)) !important;
        }
      }
    }
    .el-submenu:hover > .el-submenu__title {
      .svg-icon,
      .sub-el-icon {
        color: rgb(22 93 255 / var(--tw-text-opacity, 1)) !important;
      }
    }
    // 带子菜单的menu 背景色设置 // 首页，没有子菜单的背景色菜单的背景色设置
    .el-submenu > .el-submenu__title,
    .el-menu-item.submenu-title-noDropdown {
      height: 48px;
      line-height: 48px;
      margin-bottom: 3px;
      border-radius: 0.5rem;
    }
    .el-submenu.is-active:hover > .el-submenu__title {
      background: rgb(22 93 255 / 0.1) !important;
    }
    .el-submenu:hover > .el-submenu__title,
    .el-menu-item.submenu-title-noDropdown {
      background: rgba(255, 255, 255, 0.02) !important;
      height: 48px;
      line-height: 48px;
      margin-bottom: 3px;
      border-radius: 0.5rem;
    }
    .el-menu-item.submenu-title-noDropdown:hover {
      background: rgba(255, 255, 255, 0.05);
      border-color: none;
      box-shadow: none;
    }
    // 选中状态的sub-menu背景色
    .is-active > .el-submenu__title,
    .is-active.submenu-title-noDropdown {
      color: $subMenuActiveText !important;
      background-color: rgb(22 93 255 / 0.1) !important;
    }

    .el-submenu .el-menu-item {
      height: 40px;
      line-height: 40px;
      padding-left: 20px;
    }

    // 二级菜单
    // & .nest-menu .el-submenu > .el-submenu__title,
    .el-submenu.is-opened .nest-menu a,
    .el-submenu.is-opened .nest-menu > .el-submenu > .el-submenu__title {
      width: 200px;
      // min-width: $sideBarWidth !important;
      background: rgba(255, 255, 255, 0.02);
      border-left: 3px solid var(--primary);
      color: var(--light);
      border-radius: 0.5rem;
      margin: 3px 0 5px 20px;
    }
    .el-submenu .nest-menu a {
      margin: 3px 0 5px 20px;
    }
    //  三级菜单样式
    .el-submenu .nest-menu .el-submenu .nest-menu a {
      background: rgba(255, 255, 255, 0.02);
      .el-menu-item {
        padding-left: 40px !important;
      }
    }
    .el-submenu.is-opened .nest-menu .router-link-active {
      box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
      border-radius: 0.5rem;
      border-left: 3px solid #00d4ff;
      position: relative;
      &::before {
        content: "";
        position: absolute;
        left: 180px; // 初始位置在右侧外部
        top: 50%;
        transform: translateY(-50%);
        width: 3px;
        height: 20px;
        background-color: #00d4ff;
        border-radius: 0 3px 3px 0;
        animation: slideFromRight 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94)
          forwards;
      }
    }
  }

  .hideSidebar {
    .sidebar-container {
      width: 54px !important;
    }

    .main-container {
      margin-left: 54px;
    }

    .submenu-title-noDropdown {
      padding: 0 !important;
      position: relative;

      .el-tooltip {
        padding: 0 !important;

        .svg-icon {
          margin-left: 20px;
        }

        .sub-el-icon {
          margin-left: 19px;
        }
      }
    }

    .el-submenu {
      overflow: hidden;

      & > .el-submenu__title {
        padding: 0 !important;

        .svg-icon {
          margin-left: 20px;
        }

        .sub-el-icon {
          margin-left: 19px;
        }

        .el-submenu__icon-arrow {
          display: none;
        }
      }
    }

    .el-menu--collapse {
      .el-submenu {
        & > .el-submenu__title {
          & > span {
            height: 0;
            width: 0;
            overflow: hidden;
            visibility: hidden;
            display: inline-block;
          }
        }
      }
    }
  }
  .el-submenu__title i {
    color: #fff;
    font-weight: 700;
  }
  .el-menu--collapse .el-menu .el-submenu {
    min-width: $sideBarWidth !important;
  }

  // mobile responsive
  .mobile {
    .main-container {
      margin-left: 0px;
    }

    .sidebar-container {
      transition: transform 0.28s;
      width: $sideBarWidth !important;
    }

    &.hideSidebar {
      .sidebar-container {
        pointer-events: none;
        transition-duration: 0.3s;
        transform: translate3d(-$sideBarWidth, 0, 0);
      }
    }
  }

  .withoutAnimation {
    .main-container,
    .sidebar-container {
      transition: none;
    }
  }
}

// when menu collapsed
.el-menu--vertical {
  & > .el-menu {
    .svg-icon {
      margin-right: 16px;
    }
    .sub-el-icon {
      margin-right: 12px;
      margin-left: -2px;
    }
  }

  // the scroll bar appears when the subMenu is too long
  > .el-menu--popup {
    max-height: 100vh;
    overflow-y: auto;

    &::-webkit-scrollbar-track-piece {
      background: #d3dce6;
    }

    &::-webkit-scrollbar {
      width: 6px;
    }

    &::-webkit-scrollbar-thumb {
      background: #99a9bf;
      border-radius: 20px;
    }
  }
}

// 选中menu的小蓝书条滑动到左侧
@keyframes slideFromRight {
  from {
    left: 180px;
  }
  to {
    left: 2px;
  }
}
